#异常处理
import traceback
d={}
try:
    1/0
    # a[1]
    # d["abc"]
# except ZeroDivisionError as e:
#     print(e)
#     print("出错了")
# except IndexError as e:
#     print(e)
except Exception as e:
    print(e)
    traceback.print_exc()  #打印报错信息
else:
    print("不出错走这里")
finally:        #不管是否报错都会走到该语句
    print("什么时候执行呢？")